package com.salton123.groupbargain.mvvm.viewmodel

import android.app.Application
import com.salton123.arch.model.SingleLiveEvent
import com.salton123.arch.mvvm.viewmodel.BaseRefreshViewModel
import com.salton123.bmob.bargain.BargainItem
import com.salton123.groupbargain.mvvm.model.BargainModel

/**
 * User: newSalton@outlook.com
 * Date: 2020-01-26 20:18
 * ModifyTime: 20:18
 * Description:
 */
class BargainViewModel(
    application: Application,
    model: BargainModel
) :
    BaseRefreshViewModel<BargainModel, BargainItem>(
        application, model
    ) {
     var mBargainRecommendEvent: SingleLiveEvent<List<BargainItem>> = SingleLiveEvent()
    fun init() {
        mModel.getRecommendBargainList()
            .subscribe({
                mBargainRecommendEvent.postValue(it)
//                postSuccessViewEvent(true)
            }, {
//                postShowNoDataViewEvent(true)
            })
    }

}